package com.example.shop.goods.enums;

/**
 * 返回结果集的排序方式，默认是ASC升序
 */
public enum SortOrder {
    //升序
    ASC("ASC"),
    //降序
    DESC("DESC");

    public static final String SORT_WAY_SQL =
        " " +
        "<choose>" +
            "<when test='ew.sortOrder != null'>" +
                "${ew.sortOrder.getDbField()} " +
            "</when>" +
            "<otherwise>" +
                "ASC " +
            "</otherwise>" +
        "</choose>" +
        " ";
    private String dbField;
    SortOrder(String dbField){
        this.dbField = dbField;
    }

    public String getDbField() {
        return dbField;
    }
}
